<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:c="http://java.sun.com/jsp/jstl/core">

    <h:head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <h:outputStylesheet library="css" name="style.css" />
        <h:outputStylesheet library="css" name="table.css" />
        <h:outputStylesheet library="css" name="table-style.css"  />
        <title>FamTime - Be part of it!</title>
    </h:head>

    <h:body>
        <div id="main">
            <div id="Event1" >

                <h:form id="addEventForm" rendered="#{kalenderPM.notSubmitted(getterBean.passedParameter)}">
                    #{kalenderPM.initB(kalenderPM.findEventByID(getterBean.passedParameter))}  
                    <h:panelGrid columns="2" rendered="true">

                        <h:outputLabel for="titel">Titel:</h:outputLabel>

                        <h:inputText id="titel" value="#{kalenderPM.eTitle}" title="Titel"/>

                        <h:outputLabel for="description">Beschreibung:</h:outputLabel>

                        <h:inputTextarea style="resize: none;" cols="25" rows="2" id="description" value="#{kalenderPM.eDescription}" title="Beschreibung" />

                        <h:outputLabel for="startTime" >Beginn(dd.MM.yyyy HH:mm):</h:outputLabel>

                        <h:inputText id="startTime" value="#{kalenderPM.eStartTime}" 
                                     size="20" required="true"
                                     label="startTime" >					
                            <f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" timeZone="GMT+1" timeStyle="short" locale="de" dateStyle="short "/>
                        </h:inputText>


                        <h:outputLabel for="endTime" >Ende(dd.MM.yyyy HH:mm):</h:outputLabel>

                        <h:inputText id="endTime" value="#{kalenderPM.eEndTime}" 
                                     size="20" required="true"
                                     label="endTime" >					
                            <f:convertDateTime type="both" pattern="dd.MM.yyyy HH:mm" timeZone="GMT+1" timeStyle="short" locale="de" dateStyle="short" />
                        </h:inputText>  


                        <h:commandButton value="Bearbeiten" action="#{kalenderPM.editEvent()}"/>
                        <p/>
                        <h:commandButton value="Entfernen" action="#{kalenderPM.removeEvent()}" />


                    </h:panelGrid>
                </h:form>
            </div>
        </div>
    </h:body>
</html>
